package com.opesoft.calendar.model;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

import org.hibernate.annotations.ForeignKey;

@Entity
@Table(name="noteconfigvalue")
public class NoteConfigValue implements Serializable
{
	@Id
	@GeneratedValue(strategy=GenerationType.TABLE, generator="NoteConfigValueIdGenerator")
	@TableGenerator(name="NoteConfigValueIdGenerator", table="ids", pkColumnName="entity", valueColumnName="maxid", pkColumnValue="NoteConfigValue", allocationSize=1)
	long id;

	@Basic
	@Column(name="note")
	Long noteId;

	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="note", insertable=false, updatable=false)
	@ForeignKey(name="fk_note_config_value_1")
	Note note;

	@Basic
	@Column(name="noteConfig")
	Long noteConfigId;

	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="noteConfig", insertable=false, updatable=false)
	@ForeignKey(name="fk_note_config_value_2")
	NoteConfig noteConfig;

	@Basic
	String value;

	public long getId()
	{
		return id;
	}

	public void setId(long id)
	{
		this.id=id;
	}

	public Long getNoteId()
	{
		return noteId;
	}

	public void setNoteId(Long noteId)
	{
		this.noteId=noteId;
	}

	public Note getNote()
	{
		return note;
	}

	public void setNote(Note note)
	{
		this.note=note;
	}

	public Long getNoteConfigId()
	{
		return noteConfigId;
	}

	public void setNoteConfigId(Long noteConfigId)
	{
		this.noteConfigId=noteConfigId;
	}

	public NoteConfig getNoteConfig()
	{
		return noteConfig;
	}

	public void setNoteConfig(NoteConfig noteConfig)
	{
		this.noteConfig=noteConfig;
	}

	public String getValue()
	{
		return value;
	}

	public void setValue(String value)
	{
		this.value=value;
	}
}
